<?php


$loader->requireOnce('controllers/C_Search.class.php');
$loader->requireOnce('includes/LabSearch/LabSearchFilter.class.php');
$loader->requireOnce('includes/LabSearch/LabSearchResultView.class.php');


/**
 * Controler for searching.
 * @package modules.dept_laboratory.controllers
 * @author viethd
 * @version $Id$
 * @copyright 2009 LHV Company
 */
class C_LabSearch extends C_Search {
    private $logger ;

    function __construct($template_mod = "general") {
        parent::__construct();
        $this->logger = LoggerManager::getLogger('local.controllers.C_LabSearch');
        $this->view->path="lab_search";
        
        $this->searchFilter = new LabSearchFilter();
        $this->searchFilter->setController($this);
        
        $this->searchResultView = new LabSearchResultView();
    }

    public function actionSearchAjax($filterData = array()) {
        $this->logger->info("Start actionSearchAjax");
        $filterData = array(
            'patientCode'   =>  '',
            'patientName'   =>  '',
            'gender'        =>  '');
        if (isset($_POST['patientCode'])) {
            $filterData['patientCode'] = Utils::sanitizeText($_POST['patientCode']);
			
        }

        if (isset($_POST['patientName'])) {
            $filterData['patientName'] = Utils::sanitizeText($_POST['patientName']);
			
        }

        if (isset($_POST['gender'])) {
            $filterData['gender'] = Utils::sanitizeText($_POST['gender']);

        }
        $result = parent::actionSearchAjax($filterData);
        $this->logger->info("Finish actionSearchAjax");
        return $result;
    }



}
?>